<template>
  <div >

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5" >
        <!--h3 >货物详情</h3-->
        <el-tag type="" size="medium" effect="dark">货物详情</el-tag>
      </el-col>      
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          :disabled="select"
          @click="handleAdd"
          
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-s-release"
          size="mini"
          :disabled="multiple"
          @click="handleRemove"
          
        >移除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          
        >导出</el-button>
      </el-col>
      <!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" @computeTable="computeTableHeight"></right-toolbar-->
    </el-row>

    <el-table  :data="goodList" @selection-change="handleSelectionChange" border :height="tableHeight" :row-style="{height:'35px'}" :cell-style="{padding:'0px'}">
      <el-table-column type="selection" width="45" align="center" />
      <el-table-column type="index" prop="" width="55" label="序号" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.$index+1 +(queryParams.pageNum-1)*queryParams.pageSize }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100%">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-s-release"
            @click="handleRemove(scope.row)"
            
          >移除</el-button>
        </template>
      </el-table-column>
      <!--el-table-column label="货物ID" align="center" prop="goodsId" /-->
      <el-table-column label="货物类型" align="center" prop="goodsType">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.goods_type" :value="scope.row.goodsType"/>
        </template-->
      </el-table-column>
      <el-table-column label="捆包号" align="center" prop="bundleNumber" width="180" :show-overflow-tooltip="true" />
      <!--el-table-column label="产地" align="center" prop="producer" /-->
      <el-table-column label="品名" align="center" prop="product" />
      <el-table-column label="规格" align="center" prop="specification" width="110" :show-overflow-tooltip="true" />
      <el-table-column label="材质" align="center" prop="steelGrade" />
      <el-table-column label="重量(吨)" align="center" prop="weight" />
      <el-table-column label="合约号" align="center" prop="agreementNumber" width="110" :show-overflow-tooltip="true" />
      <el-table-column label="合同号" align="center" prop="contractNumber" width="160" :show-overflow-tooltip="true" />
      <!--el-table-column label="生产日期" align="center" prop="produceDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.produceDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column-->
      <!--el-table-column label="记录来源" align="center" prop="recordSource" /-->
      <!--el-table-column label="库存状态" align="center" prop="inventoryStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.inventory_status" :value="scope.row.inventoryStatus"/>
        </template>
      </el-table-column-->
      <el-table-column label="仓库类型" align="center" prop="warehouseType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.warehouse_type" :value="scope.row.warehouseType"/>
        </template>
      </el-table-column>
      <el-table-column label="园区信息" align="center" prop="logisticsParkName">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.logisticsParkName"/>
        </template-->
      </el-table-column>
      <el-table-column label="仓位信息" align="center" prop="warehouseLocateName">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.warehouseLocateName"/>
        </template-->
      </el-table-column>
      <el-table-column label="区位信息" align="center" prop="regionLocateName">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.regionLocateName"/>
        </template-->
      </el-table-column>
      <el-table-column label="货位信息" align="center" prop="goodsLocateName">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.goodsLocateName"/>
        </template-->
      </el-table-column>

      <!--el-table-column label="发货客户" align="center" prop="sendGoodsCustomer" width="240" :show-overflow-tooltip="true"-->
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.sendGoodsCustomer"/>
        </template-->
      <!--/el-table-column-->
      <el-table-column label="目的流向" align="center" prop="endFlowDirection" width="280" :show-overflow-tooltip="true">
        <!--template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.endFlowDirection"/>
        </template-->
      </el-table-column>
      <el-table-column label="目的卸点" align="center" prop="endUnloadPoint" />
      <!--el-table-column label="运单编号" align="center" prop="wayBillNumber" width="100" />
      <el-table-column label="付费方式" align="center" prop="paymentMode">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.settlement_mode" :value="scope.row.paymentMode"/>
        </template>
      </el-table-column>
      <el-table-column label="运费计价" align="center" prop="freightPriceMode">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.price_mode" :value="scope.row.freightPriceMode"/>
        </template>
      </el-table-column>
      <el-table-column label="运费价格" align="center" prop="freightPrice" />
      <el-table-column label="运费金额" align="center" prop="freightAmount" />
      <el-table-column label="运费补贴" align="center" prop="primage" />
      <el-table-column label="运费总额" align="center" prop="freightTotalAmount" />
      <el-table-column label="结算方式" align="center" prop="settlementMethod">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.settlement_mode" :value="scope.row.settlementMethod"/>
        </template>
      </el-table-column>
      <el-table-column label="结算计价" align="center" prop="settlementPriceMode">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.price_mode" :value="scope.row.settlementPriceMode"/>
        </template>
      </el-table-column>
      <el-table-column label="结算价格" align="center" prop="settlementPrice" />
      <el-table-column label="结算金额" align="center" prop="settlementAmount" />
      <el-table-column label="附加运费" align="center" prop="premiumFreight" />
      <el-table-column label="结算总额" align="center" prop="settlementTotalAmount" />
      <el-table-column label="货运付费账单号" align="center" prop="freightPaymentBillNumber"  width="160"/>
      <el-table-column label="货运结算账单号" align="center" prop="freightSettlementBillNumber"  width="160"/>
      <el-table-column label="其他编号" align="center" prop="otherNumber" />
      <el-table-column label="三方编号" align="center" prop="threePartyNumber" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column-->

    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改货物信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-form-item label="捆包号" prop="bundleNumber">
          <el-input v-model="form.bundleNumber" placeholder="请输入捆包号" />
        </el-form-item>
        <el-form-item label="货物类型" prop="goodsType">
          <el-select v-model="form.goodsType" placeholder="请选择货物类型" style="width: 340px;">
            <el-option
              v-for="dict in dict.type.goods_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="产地" prop="producer">
          <el-input v-model="form.producer" placeholder="请输入产地" />
        </el-form-item>
        <el-form-item label="品名" prop="product">
          <el-input v-model="form.product" placeholder="请输入品名" />
        </el-form-item>
        <el-form-item label="规格" prop="specification">
          <el-input v-model="form.specification" placeholder="请输入规格" />
        </el-form-item>
        <el-form-item label="材质" prop="steelGrade">
          <el-input v-model="form.steelGrade" placeholder="请输入材质" />
        </el-form-item>
        <el-form-item label="重量(吨)" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入重量" />
        </el-form-item>
        <el-form-item label="合约号" prop="agreementNumber">
          <el-input v-model="form.agreementNumber" placeholder="请输入合约号" />
        </el-form-item>
        <el-form-item label="合同号" prop="contractNumber">
          <el-input v-model="form.contractNumber" placeholder="请输入合同号" />
        </el-form-item>
        <!--el-form-item label="生产日期" prop="produceDate">
          <el-date-picker clearable
            v-model="form.produceDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择生产日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="记录来源" prop="recordSource">
          <el-input v-model="form.recordSource" placeholder="请输入记录来源" />
        </el-form-item>
        <el-form-item label="库存状态" prop="inventoryStatus">
          <el-select v-model="form.inventoryStatus" placeholder="请选择库存状态">
            <el-option
              v-for="dict in dict.type.inventory_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="仓库类型" prop="warehouseType">
          <el-select v-model="form.warehouseType" placeholder="请选择仓库类型" style="width: 340px;">
            <el-option
              v-for="dict in dict.type.warehouse_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="园区信息" prop="logisticsParkName">
          <el-select ref="optionRef" v-model="form.logisticsParkName" placeholder="请选择园区信息" style="width: 340px;" @change="handleChangeLogisticsPark">
            <el-option
              v-for="dict in parkLocateOptions"
                :key="dict.locateId"
                :label="dict.name"
                :value="dict.name"
              ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓位信息" prop="warehouseLocateName">
          <el-select v-model="form.warehouseLocateName" placeholder="请选择仓位信息" style="width: 340px;" @change="handleChangeWarehouseLocate">
            <el-option
              v-for="dict in warehouseLocateOptions"
                :key="dict.locateId"
                :label="dict.name"
                :value="dict.name"
              ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="区位信息" prop="regionLocateName">
          <el-select v-model="form.regionLocateName" placeholder="请选择区位信息" style="width: 340px;" @change="handleChangeRegionLocate">
            <el-option
              v-for="dict in regionLocateOptions"
                :key="dict.locateId"
                :label="dict.name"
                :value="dict.name"
              ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货位信息" prop="goodsLocateName">
          <el-select v-model="form.goodsLocateName" placeholder="请选择货位信息" style="width: 340px;" @change="handleChangeGoodsLocate">
            <el-option
              v-for="dict in goodsLocateOptions"
                :key="dict.locateId"
                :label="dict.name"
                :value="dict.name"
              ></el-option>
          </el-select>
        </el-form-item>
        <!--el-form-item label="层位信息" prop="layerLocateName">
          <el-select v-model="form.layerLocateName" placeholder="请选择层位信息">
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item-->
        <!--el-form-item label="库位信息" prop="warehouseTotalLocate">
          <el-input v-model="form.warehouseTotalLocate" placeholder="请输入库位信息" />
        </el-form-item-->
        <!--el-form-item label="入库单号" prop="enterWarehouseNumber">
          <el-input v-model="form.enterWarehouseNumber" placeholder="请输入入库单号" />
        </el-form-item>
        <el-form-item label="入库查验" prop="enterWarehouseCheck">
          <el-select v-model="form.enterWarehouseCheck" placeholder="请选择入库查验">
            <el-option
              v-for="dict in dict.type.check_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="入库客户" prop="enterWarehouseCustomer">
          <el-select v-model="form.enterWarehouseCustomer" placeholder="请选择入库客户" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
                :key="dict.customerId"
                :label="dict.customerName"
                :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="入库司机" prop="enterWarehouseDriver">
          <el-input v-model="form.enterWarehouseDriver" placeholder="请输入入库司机" />
        </el-form-item>
        <el-form-item label="入库车号" prop="enterWarehouseVehicle">
          <el-input v-model="form.enterWarehouseVehicle" placeholder="请输入入库车号" />
        </el-form-item>
        <el-form-item label="入库人" prop="enterWarehousePerson">
          <el-input v-model="form.enterWarehousePerson" placeholder="请输入入库人" />
        </el-form-item>
        <el-form-item label="入库时间" prop="enterWarehouseTime">
          <el-date-picker clearable
            v-model="form.enterWarehouseTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择入库时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入库确认人" prop="enterWarehouseConfirmPerson">
          <el-input v-model="form.enterWarehouseConfirmPerson" placeholder="请输入入库确认人" />
        </el-form-item>
        <el-form-item label="入库确认时间" prop="enterWarehouseConfirmTime">
          <el-date-picker clearable
            v-model="form.enterWarehouseConfirmTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择入库确认时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出库单号" prop="exitWarehouseNumber">
          <el-input v-model="form.exitWarehouseNumber" placeholder="请输入出库单号" />
        </el-form-item>
        <el-form-item label="出库查验" prop="exitWarehouseCheck">
          <el-select v-model="form.exitWarehouseCheck" placeholder="请选择出库查验">
            <el-option
              v-for="dict in dict.type.check_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出库客户" prop="exitWarehouseCustomer">
          <el-select v-model="form.exitWarehouseCustomer" placeholder="请选择出库客户" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
                :key="dict.customerId"
                :label="dict.customerName"
                :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出库司机" prop="exitWarehouseDriver">
          <el-input v-model="form.exitWarehouseDriver" placeholder="请输入出库司机" />
        </el-form-item>
        <el-form-item label="出库车号" prop="exitWarehouseVehicle">
          <el-input v-model="form.exitWarehouseVehicle" placeholder="请输入出库车号" />
        </el-form-item>
        <el-form-item label="出库人" prop="exitWarehousePerson">
          <el-input v-model="form.exitWarehousePerson" placeholder="请输入出库人" />
        </el-form-item>
        <el-form-item label="出库时间" prop="exitWarehouseTime">
          <el-date-picker clearable
            v-model="form.exitWarehouseTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择出库时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出库确认人" prop="exitWarehouseConfirmPerson">
          <el-input v-model="form.exitWarehouseConfirmPerson" placeholder="请输入出库确认人" />
        </el-form-item>
        <el-form-item label="出库确认时间" prop="exitWarehouseConfirmTime">
          <el-date-picker clearable
            v-model="form.exitWarehouseConfirmTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择出库确认时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="理货人" prop="adjustGoodsPerson">
          <el-input v-model="form.adjustGoodsPerson" placeholder="请输入理货人" />
        </el-form-item>
        <el-form-item label="理货时间" prop="adjustGoodsTime">
          <el-date-picker clearable
            v-model="form.adjustGoodsTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择理货时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="盘货人" prop="checkGoodsPerson">
          <el-input v-model="form.checkGoodsPerson" placeholder="请输入盘货人" />
        </el-form-item>
        <el-form-item label="盘货时间" prop="checkGoodsTime">
          <el-date-picker clearable
            v-model="form.checkGoodsTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择盘货时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="原货权客户" prop="originGoodsRightCustomer">
          <el-select v-model="form.originGoodsRightCustomer" placeholder="请选择原货权客户" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
                :key="dict.customerId"
                :label="dict.customerName"
                :value="dict.customerName"
              ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货权客户" prop="goodsRightCustomer">
          <el-select v-model="form.goodsRightCustomer" placeholder="请选择货权客户" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
                :key="dict.customerId"
                :label="dict.customerName"
                :value="dict.customerName"
              ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货转次数" prop="goodsTransferTimes">
          <el-input v-model="form.goodsTransferTimes" placeholder="请输入货转次数" />
        </el-form-item>
        <el-form-item label="货转单号" prop="goodsTransferNumber">
          <el-input v-model="form.goodsTransferNumber" placeholder="请输入货转单号" />
        </el-form-item>
        <el-form-item label="货转人" prop="goodsTransferPerson">
          <el-input v-model="form.goodsTransferPerson" placeholder="请输入货转人" />
        </el-form-item>
        <el-form-item label="货转时间" prop="goodsTransferTime">
          <el-date-picker clearable
            v-model="form.goodsTransferTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="货转审核人" prop="goodsTransferAuditPerson">
          <el-input v-model="form.goodsTransferAuditPerson" placeholder="请输入货转审核人" />
        </el-form-item>
        <el-form-item label="货转审核时间" prop="goodsTransferAuditTime">
          <el-date-picker clearable
            v-model="form.goodsTransferAuditTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="货转单IDs" prop="goodsTransferIds">
          <el-input v-model="form.goodsTransferIds" placeholder="请输入货转单IDs" />
        </el-form-item>
        <el-form-item label="室内库(元/吨)" prop="indoorWarehousePrice">
          <el-input v-model="form.indoorWarehousePrice" placeholder="请输入室内库(元/吨)" />
        </el-form-item>
        <el-form-item label="室外库(元/吨)" prop="outdoorWarehousePrice">
          <el-input v-model="form.outdoorWarehousePrice" placeholder="请输入室外库(元/吨)" />
        </el-form-item>
        <el-form-item label="仓储费" prop="storageFee">
          <el-input v-model="form.storageFee" placeholder="请输入仓储费" />
        </el-form-item>
        <el-form-item label="免堆期(天)" prop="freeStorage">
          <el-input v-model="form.freeStorage" placeholder="请输入免堆期(天)" />
        </el-form-item>
        <el-form-item label="超期计价" prop="overduePriceMode">
          <el-input v-model="form.overduePriceMode" placeholder="请输入超期计价" />
        </el-form-item>
        <el-form-item label="超期单价(元/吨)" prop="overduePrice">
          <el-input v-model="form.overduePrice" placeholder="请输入超期单价(元/吨)" />
        </el-form-item>
        <el-form-item label="库存天数" prop="storageDay">
          <el-input v-model="form.storageDay" placeholder="请输入库存天数" />
        </el-form-item>
        <el-form-item label="超期费" prop="overdueFee">
          <el-input v-model="form.overdueFee" placeholder="请输入超期费" />
        </el-form-item>
        <el-form-item label="倒垛单价(元/吨)" prop="stackTransferPrice">
          <el-input v-model="form.stackTransferPrice" placeholder="请输入倒垛单价(元/吨)" />
        </el-form-item>
        <el-form-item label="倒垛费" prop="stackTransferFee">
          <el-input v-model="form.stackTransferFee" placeholder="请输入倒垛费" />
        </el-form-item>
        <el-form-item label="仓费结算账单号" prop="warehouseSettlementBillNumber">
          <el-input v-model="form.warehouseSettlementBillNumber" placeholder="请输入仓费结算账单号" />
        </el-form-item>
        <el-form-item label="仓费结算客户" prop="warehouseSettlementCustomer">
          <el-select v-model="form.warehouseSettlementCustomer" placeholder="请选择仓费结算客户" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
                :key="dict.customerId"
                :label="dict.customerName"
                :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否货损" prop="goodsDamage">
          <el-select v-model="form.goodsDamage" placeholder="请选择是否货损">
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货损照片" prop="goodsDamagePicture">
          <image-upload v-model="form.goodsDamagePicture" :limit="2"/>
        </el-form-item>
        <el-form-item label="货物备注" prop="goodsRemark">
          <el-input v-model="form.goodsRemark" placeholder="请输入货物备注" />
        </el-form-item>
        <el-form-item label="配货状态" prop="distributeGoodsStatus">
          <el-select v-model="form.distributeGoodsStatus" placeholder="请选择配货状态">
            <el-option
              v-for="dict in dict.type.distribute_goods_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="配货车" prop="distributeGoodsCart">
          <el-input v-model="form.distributeGoodsCart" placeholder="请输入配货车" />
        </el-form-item>
        <el-form-item label="发货客户" prop="sendGoodsCustomer">
          <el-select v-model="form.sendGoodsCustomer" placeholder="请选择发货客户" clearable filterable>
            <el-option
            v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="目的流向" prop="endFlowDirection">
          <el-select v-model="form.endFlowDirection" placeholder="请选择目的流向" style="width: 340px;" filterable>
            <el-option
            v-for="dict in endFlowOptions"
              :key="dict.flowDirectionId"
              :label="dict.flowDirectionName"
              :value="dict.flowDirectionName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="目的卸点" prop="endUnloadPoint">
          <el-input v-model="form.endUnloadPoint" placeholder="请输入目的卸点" />
        </el-form-item>
        <!--el-form-item label="运单编号" prop="wayBillNumber">
          <el-input v-model="form.wayBillNumber" placeholder="请输入运单编号" />
        </el-form-item>
        <el-form-item label="付费方式" prop="paymentMode">
          <el-select v-model="form.paymentMode" placeholder="请选择付费方式">
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="运费计价" prop="freightPriceMode">
          <el-select v-model="form.freightPriceMode" placeholder="请选择运费计价">
            <el-option
              v-for="dict in dict.type.price_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="运费价格" prop="freightPrice">
          <el-input v-model="form.freightPrice" placeholder="请输入运费价格" />
        </el-form-item>
        <el-form-item label="运费金额" prop="freightAmount">
          <el-input v-model="form.freightAmount" placeholder="请输入运费金额" />
        </el-form-item>
        <el-form-item label="运费补贴" prop="primage">
          <el-input v-model="form.primage" placeholder="请输入运费补贴" />
        </el-form-item>
        <el-form-item label="运费总额" prop="freightTotalAmount">
          <el-input v-model="form.freightTotalAmount" placeholder="请输入运费总额" />
        </el-form-item>
        <el-form-item label="结算方式" prop="settlementMethod">
          <el-select v-model="form.settlementMethod" placeholder="请选择结算方式">
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算计价" prop="settlementPriceMode">
          <el-select v-model="form.settlementPriceMode" placeholder="请选择结算计价">
            <el-option
              v-for="dict in dict.type.price_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算价格" prop="settlementPrice">
          <el-input v-model="form.settlementPrice" placeholder="请输入结算价格" />
        </el-form-item>
        <el-form-item label="结算金额" prop="settlementAmount">
          <el-input v-model="form.settlementAmount" placeholder="请输入结算金额" />
        </el-form-item>
        <el-form-item label="附加运费" prop="premiumFreight">
          <el-input v-model="form.premiumFreight" placeholder="请输入附加运费" />
        </el-form-item>
        <el-form-item label="结算总额" prop="settlementTotalAmount">
          <el-input v-model="form.settlementTotalAmount" placeholder="请输入结算总额" />
        </el-form-item>
        <el-form-item label="货运付费账单号" prop="freightPaymentBillNumber">
          <el-input v-model="form.freightPaymentBillNumber" placeholder="请输入货运付费账单号" />
        </el-form-item>
        <el-form-item label="货运结算账单号" prop="freightSettlementBillNumber">
          <el-input v-model="form.freightSettlementBillNumber" placeholder="请输入货运结算账单号" />
        </el-form-item>
        <el-form-item label="其他编号" prop="otherNumber">
          <el-input v-model="form.otherNumber" placeholder="请输入其他编号" />
        </el-form-item>
        <el-form-item label="三方编号" prop="threePartyNumber">
          <el-input v-model="form.threePartyNumber" placeholder="请输入三方编号" />
        </el-form-item-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listGood, getGood, delGood, addGood, updateGood, removeGoodExitWarehouseNumber } from "@/api/goods/good";
import { listCustomerOption } from "@/api/customs/custom";
import { listFlowOption, updateFlow } from "@/api/system/flow";
import { listLocateOption } from "@/api/locates/locate";
import { isNotNull } from "@/utils/validate";

export default {
  name: "goodsDetail",
  dicts: ['warehouse_type', 'sys_yes_no', 'settlement_mode', 'price_mode', 'distribute_goods_status', 'goods_type', 'inventory_status', 'check_status'],
  data() {
    return {
      // 定义列表高度
      tableHeight: 230,
      // 定义查询高度
      queryHeight: 200,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 货物信息表格数据
      goodList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 三方编号时间范围
      daterangeProduceDate: [],
      // 三方编号时间范围
      daterangeEnterWarehouseTime: [],
      // 三方编号时间范围
      daterangeEnterWarehouseConfirmTime: [],
      // 三方编号时间范围
      daterangeExitWarehouseTime: [],
      // 三方编号时间范围
      daterangeExitWarehouseConfirmTime: [],
      // 三方编号时间范围
      daterangeAdjustGoodsTime: [],
      // 三方编号时间范围
      daterangeCheckGoodsTime: [],
      // 三方编号时间范围
      daterangeGoodsTransferTime: [],
      // 三方编号时间范围
      daterangeGoodsTransferAuditTime: [],
      // 三方编号时间范围
      daterangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        bundleNumber: null,
        goodsType: null,
        producer: null,
        product: null,
        specification: null,
        steelGrade: null,
        weight: null,
        agreementNumber: null,
        contractNumber: null,
        produceDate: null,
        recordSource: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        enterWarehouseNumber: null,
        enterWarehouseCheck: null,
        enterWarehouseCustomer: null,
        enterWarehouseDriver: null,
        enterWarehouseVehicle: null,
        enterWarehousePerson: null,
        enterWarehouseTime: null,
        enterWarehouseConfirmPerson: null,
        enterWarehouseConfirmTime: null,
        exitWarehouseNumber: null,
        exitWarehouseCheck: null,
        exitWarehouseCustomer: null,
        exitWarehouseDriver: null,
        exitWarehouseVehicle: null,
        exitWarehousePerson: null,
        exitWarehouseTime: null,
        exitWarehouseConfirmPerson: null,
        exitWarehouseConfirmTime: null,
        adjustGoodsPerson: null,
        adjustGoodsTime: null,
        checkGoodsPerson: null,
        checkGoodsTime: null,
        originGoodsRightCustomer: null,
        goodsRightCustomer: null,
        goodsTransferTimes: null,
        goodsTransferNumber: null,
        goodsTransferPerson: null,
        goodsTransferTime: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        goodsTransferIds: null,
        indoorWarehousePrice: null,
        outdoorWarehousePrice: null,
        storageFee: null,
        freeStorage: null,
        overduePriceMode: null,
        overduePrice: null,
        storageDay: null,
        overdueFee: null,
        stackTransferPrice: null,
        stackTransferFee: null,
        warehouseSettlementBillNumber: null,
        warehouseSettlementCustomer: null,
        goodsDamage: null,
        goodsDamagePicture: null,
        goodsRemark: null,
        distributeGoodsStatus: null,
        distributeGoodsCart: null,
        sendGoodsCustomer: null,
        endFlowDirection: null,
        endUnloadPoint: null,
        wayBillNumber: null,
        paymentMode: null,
        freightPriceMode: null,
        freightPrice: null,
        freightAmount: null,
        primage: null,
        freightTotalAmount: null,
        settlementMethod: null,
        settlementPriceMode: null,
        settlementPrice: null,
        settlementAmount: null,
        premiumFreight: null,
        settlementTotalAmount: null,
        freightPaymentBillNumber: null,
        freightSettlementBillNumber: null,
        otherNumber: null,
        threePartyNumber: null,
        createBy: null,
        createTime: null,
      },
      // 表单参数
      form: {},
      // 字典项客户
      customerOptions: [],
      // 字典项始发流向
      beginFlowOptions: [],
      // 字典项目的流向
      endFlowOptions: [],
      // 字典项园区信息
      parkLocateOptions: [],
      // 字典项仓位信息
      warehouseLocateOptions: [],
      // 字典项区位信息
      regionLocateOptions: [],
      // 字典项货位信息
      goodsLocateOptions: [],
      //
      exitWarehouseNumber: null,
      //
      select: true,
      // 表单校验
      rules: {
        bundleNumber: [
          { required: true, message: "捆包号不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
//    this.getList();
    this.getOption();
//    console.log('this.dicts',this.dicts);
//    console.log('this.dict',this.dict);
//    console.log('this.customerOptions',this.customerOptions);
  },
  mounted() {
    this.$nextTick(() =>{
       // 监听浏览器高度变化，改变表格高度
      window.onresize = () =>{
        this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      }
    })
  },
  methods: {
    /** 查询货物信息列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeProduceDate && '' != this.daterangeProduceDate) {
        this.queryParams.params["beginProduceDate"] = this.daterangeProduceDate[0];
        this.queryParams.params["endProduceDate"] = this.daterangeProduceDate[1];
      }
      if (null != this.daterangeEnterWarehouseTime && '' != this.daterangeEnterWarehouseTime) {
        this.queryParams.params["beginEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[0];
        this.queryParams.params["endEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[1];
      }
      if (null != this.daterangeEnterWarehouseConfirmTime && '' != this.daterangeEnterWarehouseConfirmTime) {
        this.queryParams.params["beginEnterWarehouseConfirmTime"] = this.daterangeEnterWarehouseConfirmTime[0];
        this.queryParams.params["endEnterWarehouseConfirmTime"] = this.daterangeEnterWarehouseConfirmTime[1];
      }
      if (null != this.daterangeExitWarehouseTime && '' != this.daterangeExitWarehouseTime) {
        this.queryParams.params["beginExitWarehouseTime"] = this.daterangeExitWarehouseTime[0];
        this.queryParams.params["endExitWarehouseTime"] = this.daterangeExitWarehouseTime[1];
      }
      if (null != this.daterangeExitWarehouseConfirmTime && '' != this.daterangeExitWarehouseConfirmTime) {
        this.queryParams.params["beginExitWarehouseConfirmTime"] = this.daterangeExitWarehouseConfirmTime[0];
        this.queryParams.params["endExitWarehouseConfirmTime"] = this.daterangeExitWarehouseConfirmTime[1];
      }
      if (null != this.daterangeAdjustGoodsTime && '' != this.daterangeAdjustGoodsTime) {
        this.queryParams.params["beginAdjustGoodsTime"] = this.daterangeAdjustGoodsTime[0];
        this.queryParams.params["endAdjustGoodsTime"] = this.daterangeAdjustGoodsTime[1];
      }
      if (null != this.daterangeCheckGoodsTime && '' != this.daterangeCheckGoodsTime) {
        this.queryParams.params["beginCheckGoodsTime"] = this.daterangeCheckGoodsTime[0];
        this.queryParams.params["endCheckGoodsTime"] = this.daterangeCheckGoodsTime[1];
      }
      if (null != this.daterangeGoodsTransferTime && '' != this.daterangeGoodsTransferTime) {
        this.queryParams.params["beginGoodsTransferTime"] = this.daterangeGoodsTransferTime[0];
        this.queryParams.params["endGoodsTransferTime"] = this.daterangeGoodsTransferTime[1];
      }
      if (null != this.daterangeGoodsTransferAuditTime && '' != this.daterangeGoodsTransferAuditTime) {
        this.queryParams.params["beginGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[0];
        this.queryParams.params["endGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[1];
      }
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
        this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
      }
      listGood(this.queryParams).then(response => {
        this.goodList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getDetail(number){
      if(isNotNull(number)){
        this.select = false;
      }
      this.queryParams.exitWarehouseNumber = number;
      this.exitWarehouseNumber = number;
      //console.log("this.exitWarehouseNumber", this.exitWarehouseNumber);
      listGood(this.queryParams).then(response => {
        this.goodList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
//      console.log('Plan getDetail');
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        goodsId: null,
        bundleNumber: null,
        goodsType: null,
        producer: null,
        product: null,
        specification: null,
        steelGrade: null,
        weight: null,
        agreementNumber: null,
        contractNumber: null,
        produceDate: null,
        recordSource: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        enterWarehouseNumber: null,
        enterWarehouseCheck: null,
        enterWarehouseCustomer: null,
        enterWarehouseDriver: null,
        enterWarehouseVehicle: null,
        enterWarehousePerson: null,
        enterWarehouseTime: null,
        enterWarehouseConfirmPerson: null,
        enterWarehouseConfirmTime: null,
        exitWarehouseNumber: null,
        exitWarehouseCheck: null,
        exitWarehouseCustomer: null,
        exitWarehouseDriver: null,
        exitWarehouseVehicle: null,
        exitWarehousePerson: null,
        exitWarehouseTime: null,
        exitWarehouseConfirmPerson: null,
        exitWarehouseConfirmTime: null,
        adjustGoodsPerson: null,
        adjustGoodsTime: null,
        checkGoodsPerson: null,
        checkGoodsTime: null,
        originGoodsRightCustomer: null,
        goodsRightCustomer: null,
        goodsTransferTimes: null,
        goodsTransferNumber: null,
        goodsTransferPerson: null,
        goodsTransferTime: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        goodsTransferIds: null,
        indoorWarehousePrice: null,
        outdoorWarehousePrice: null,
        storageFee: null,
        freeStorage: null,
        overduePriceMode: null,
        overduePrice: null,
        storageDay: null,
        overdueFee: null,
        stackTransferPrice: null,
        stackTransferFee: null,
        warehouseSettlementBillNumber: null,
        warehouseSettlementCustomer: null,
        goodsDamage: null,
        goodsDamagePicture: null,
        goodsRemark: null,
        distributeGoodsStatus: null,
        distributeGoodsCart: null,
        sendGoodsCustomer: null,
        endFlowDirection: null,
        endUnloadPoint: null,
        wayBillNumber: null,
        paymentMode: null,
        freightPriceMode: null,
        freightPrice: null,
        freightAmount: null,
        primage: null,
        freightTotalAmount: null,
        settlementMethod: null,
        settlementPriceMode: null,
        settlementPrice: null,
        settlementAmount: null,
        premiumFreight: null,
        settlementTotalAmount: null,
        freightPaymentBillNumber: null,
        freightSettlementBillNumber: null,
        otherNumber: null,
        threePartyNumber: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeProduceDate = [];
      this.daterangeEnterWarehouseTime = [];
      this.daterangeEnterWarehouseConfirmTime = [];
      this.daterangeExitWarehouseTime = [];
      this.daterangeExitWarehouseConfirmTime = [];
      this.daterangeAdjustGoodsTime = [];
      this.daterangeCheckGoodsTime = [];
      this.daterangeGoodsTransferTime = [];
      this.daterangeGoodsTransferAuditTime = [];
      this.daterangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.goodsId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加货物信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const goodsId = row.goodsId || this.ids
      getGood(goodsId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改货物信息";
        this.handleLoadOptions();
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.goodsId != null) {
            updateGood(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            this.form.exitWarehouseNumber = this.exitWarehouseNumber;
            this.form.recordSource = "PC";
            addGood(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
              
            });
          }
        }
      });
    },
    /** 移除按钮操作 */
    handleRemove(row) {
      const goodsIds = row.goodsId || this.ids;
      //console.log('this.exitWarehouseNumber', this.exitWarehouseNumber);
      const number = this.exitWarehouseNumber;
      this.$modal.confirm('是否确认移除货物信息编号为"' + goodsIds + '"的数据项？').then(function() {
        //console.log('goodsIds', goodsIds);
        return removeGoodExitWarehouseNumber(goodsIds, number);
      }).then(() => {
        //this.getList();
        this.$parent.getList();
        //
        //this.$parent.handleHasSelectRow();
        this.$modal.msgSuccess("移除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('goods/good/export', {
        ...this.queryParams
      }, `good_${new Date().getTime()}.xlsx`)
    },
    computeTableHeight(){
      if( this.showSearch==true ){
        this.tableHeight = window.innerHeight - this.queryHeight - 28 - 28 - 160;
      } else {
        this.tableHeight = window.innerHeight - 28 - 28 - 160;
      }
    },
    getOption() {
      /** 字典项客户*/
      listCustomerOption().then(response => {
        this.customerOptions = response.data;

//        console.log('this.customerOptions',this.customerOptions);
      });
      /** 字典项流向 */
      var compare = function (obj1, obj2) {
          var val1 = obj1.endFlowClickNumber;
          var val2 = obj2.endFlowClickNumber;
          if (val1 < val2) {
              return 1;
          } else if (val1 > val2) {
              return -1;
          } else {
              return 0;
          }            
      } 
      listFlowOption().then(response => {
        this.beginFlowOptions = JSON.parse(JSON.stringify(response.data));
        this.endFlowOptions = JSON.parse(JSON.stringify(response.data));
        this.endFlowOptions.sort(compare);
//        console.log('this.beginFlowOptions', this.beginFlowOptions);
//        console.log('this.endFlowOptions',this.endFlowOptions);
      });

      /** 字典项园区 */
      listLocateOption(0).then(response => {
        this.parkLocateOptions = response.data;

//        console.log('this.parkLocateOptions',this.parkLocateOptions);
      });
    },
    handleChangeLogisticsPark(value) {
//      console.log('handleChangeLogisticsPark', value);
//      console.log('this.$refs.optionRef.selected.value', this.$refs.optionRef.selected.value);
//      console.log('this.$refs.optionRef.selected.label', this.$refs.optionRef.selected.label);
//      console.log('this.$refs.optionRef.selected.key', this.$refs.optionRef.selected.key);
      let park = {};
      park = this.parkLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
//      console.log('park', park);
//      this.form.logisticsParkName = value.name;
//      console.log('handleChangeLogisticsPark', label);
      /** 字典项仓库 */
      listLocateOption(park.locateId).then(response => {
        this.warehouseLocateOptions = response.data;
        this.regionLocateOptions = {};
        this.goodsLocateOptions = {};
        this.form.warehouseLocateName = '';
        this.form.regionLocateName = '';
        this.form.goodsLocateName = '';
//        console.log('this.warehouseLocateOptions',this.warehouseLocateOptions);
      });
    },
    handleChangeWarehouseLocate(value) {
//      console.log('handleChangeWarehouse', value);
      let warehouse = {};
      warehouse = this.warehouseLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
      this.$set(this.form, 'warehouseType', warehouse.warehouseType);
//      console.log('warehouse', warehouse);
      /** 字典项区位 */
      listLocateOption(warehouse.locateId).then(response => {
        this.regionLocateOptions = response.data;
        this.goodsLocateOptions = {};
        this.form.regionLocateName = '';
        this.form.goodsLocateName = '';
//        console.log('this.regionLocateOptions',this.regionLocateOptions);
      });
    },
    handleChangeRegionLocate(value) {
//      console.log('handleChangeWarehouse', value);
      let region = {};
      region = this.regionLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
//      console.log('region', region);
      /** 字典项货位 */
      listLocateOption(region.locateId).then(response => {
        this.goodsLocateOptions = response.data;
        this.form.goodsLocateName = '';

//        console.log('this.goodsLocateOptions',this.goodsLocateOptions);
      });
    },
    handleChangeGoodsLocate(value) {
      this.form.warehouseTotalLocate = this.form.logisticsParkName + this.form.warehouseLocateName + this.form.regionLocateName + this.form.goodsLocateName;
    },
    //
    handleLoadOptions(){
//      if(this.form.logisticsParkName != ''){
      if(isNotNull(this.form.logisticsParkName)){
//        console.log("this.form.logisticsParkName = ", this.form.logisticsParkName);
        let park = {};
        park = this.parkLocateOptions.find((item) => {
          return item.name === this.form.logisticsParkName; //筛选出匹配数据
        });
        /** 字典项仓库 */
        listLocateOption(park.locateId).then(response => {
          this.warehouseLocateOptions = response.data;

          if (this.form.warehouseLocateName != '') {
//            console.log("this.form.warehouseLocateName = ", this.form.warehouseLocateName);
            let warehouse = {};
            warehouse = this.warehouseLocateOptions.find((item) => {
              return item.name === this.form.warehouseLocateName; //筛选出匹配数据
            });
            /** 字典项区位 */
            listLocateOption(warehouse.locateId).then(response => {
              this.regionLocateOptions = response.data;
              if (this.form.regionLocateName != '') {
//                console.log("this.form.regionLocateName = ", this.form.regionLocateName);
                let region = {};
                region = this.regionLocateOptions.find((item) => {
                  return item.name === this.form.regionLocateName; //筛选出匹配数据
                });
                /** 字典项货位 */
                listLocateOption(region.locateId).then(response => {
                  this.goodsLocateOptions = response.data;
                });
              }
            });
          }
        });
      }

    },
    clearDetail(){
//      console.log('clearDetail');
      this.goodList = [];
    },
  }
};
</script>
